<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- Vue -->

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript" src="../../js/qs.js"></script>
<script type="text/javascript" src="../../js/jquery-3.1.0.js"></script>
<link href="http://cdn.xtcrm.com/cdn//v7/fm/ub/css/icons.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../css/purchasedesc.css" />
</head>

<body class="bg-lightbule">
	<title>采购单：2018030201销售产品采购</title>
	<div class="enlarged forced" id="wrapper">
		<div class="content m-20" id="idid">
			<div class="container-fluid">
				<div id="downing"
					style="left: 719px; top: 300px; display: none; position: fixed; z-index: 10000;">
					<i class="fa-li fa fa-spinner fa-spin fa-4x"></i>
				</div>
				<div id="del"
					style="position: absolute; visibility: hidden; &amp; amp; #9; left: 0; &amp; amp; #9; top: 0; width: 0; &amp; amp; #9; height: 0; z-index: 100; background-color: #D4D0C8;"></div>
				<!-- basewin iframe -->

				<div tabindex="-1" class="modal fade" id="popshow_container"
					role="dialog" aria-hidden="true" aria-labelledby="myModalLabel"
					style="display: none;">
					<div class="modal-dialog modal-xg">
						<div class="modal-content" id="popshow_container_content"
							style="padding: 0px 0px; border-width: 0px; height: 0px;">
							<div class="modal-body " id="popshow" style="display: none;">
								<div id="popshowcont">
									<div id="gedit"></div>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div tabindex="-1" class="modal fade" id="popact" role="dialog"
					aria-hidden="true" aria-labelledby="myModalLabel"
					style="display: none;">
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<button class="close" aria-hidden="true" type="button"
									data-dismiss="modal">×</button>
								<h4 class="modal-title">操作</h4>
							</div>
							<div class="modal-body"></div>
							<div class="modal-footer">
								<div id="editsublayer"
									style="position: absolute; visibility: hidden; &amp; amp; #9; left: 0; &amp; amp; #9; top: 0; width: 0; &amp; amp; #9; height: 0;">
								</div>
								<!-- <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary waves-effect waves-light">保存</button> -->
							</div>
						</div>
						<!-- /.modal-content -->
					</div>
					<!-- /.modal-dialog -->
				</div>
				<!-- /.modal -->

				<div id="purchase_qshow" style="background-color: #FFFFFF">
					<div id="qshow" style="z-index: 0">

						<div class="portlet form-horizontal border-n">
							<div class="portlet-heading portlet-default">
								<div class="pull-right  f-s-12">
									<button class="btn btn-white waves-effect waves-light"
										onclick="vopen('http://cdn.xtcrm.com/cdn/v8/associated_table/?main=purchase&amp;id=47&amp;sid=12&amp;ssn=qkq213kbcgfer2ohajhmtsge03&amp;ccn=d002&amp;cr=5b6bbd7340b98712a7b9e0aaf6d2e64a&amp;origin=http%3A%2F%2Fcrm.xtcrm.com&amp;47&amp;mdb=a4eaa3','actrun',999,600);">
										<i></i>查看关联订单
									</button>
									&nbsp;
									<!--<span class="button_close_qshow"><button class=" btn btn-default waves-effect waves-light m-r-5" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close m-r-5"></i>关闭</button></span>-->

								</div>
								<h4 class="modal-title text-dark">
									 <a title=""
										href="/purchaseList"
										target="_blank" data-toggle="tooltip"
										data-original-title="数据日志" data-placement="bottom">
										<span set-lan="html:采购单" style="color:#000">采购单</span><i
										class="fa fa-bars m-r-5"></i></a>
								</h4>
								<hr class="border-t-a">

							</div>
							<div class="gedit_scroll_content">
								<div class="panel-collapse collapse in" id="bg-default">
									<div class="portlet-body p-t-0 p-r-7 show-box">
										<div class="row">
											<div class="col-md-12">
												<div class="form-group ">
													<label class="control-label col-md-2">采购主题:</label>
													<div class="form-control  col-md-10">${list.theme}</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-12">
												<div class="form-group ">
													<label class="control-label col-md-2">供应商(客户):</label>
													<div class="form-control  col-md-10">
														<span style="font-weight: normal; color: #9e9e9e">〖</span>${list.supname }
														<a
															href="javascript:vopen('/xcrm/customer/customer/detail.xt?id=84','customer84',999,600);"><i
															class="fa fa-folder-open m-l-5" data-toggle="tooltip"
															data-original-title="打开详细页面" data-placement="bottom"></i></a><span
															style="font-weight: normal; color: #9e9e9e">〗</span>
													</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-12">
												<div class="form-group ">
													<label class="control-label col-md-2">供应商联系人:</label>
													<div class="form-control  col-md-10">${list.smname}</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">采购日期:</label>
													<div class="form-control  col-md-8">${list.schtime }</div>
												</div>
											</div>
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">仓库:</label>
													<div class="form-control  col-md-8">${list.dgsname}</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">预计到货日期:</label>
													<div class="form-control  col-md-8">${list.schpretime}</div>
												</div>
											</div>
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">分类:</label>
													<div class="form-control  col-md-8">${list.sctype}</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">经手人:</label>
													<div class="form-control  col-md-8">${list.use_name }</div>
												</div>
											</div>
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">状态:</label>
													<div class="form-control  col-md-8">${list.schstates}</div>
												</div>
											</div>
										</div>

										<div class="row">
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">金额:</label>
													<div class="form-control  col-md-8">
														<span style="white-space: nowrap"><span
															style="font-size: 9pt; font-weight: normal;">￥</span>${list.schsum}</span>
													</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">付款票据:</label>
													<div class="form-control  col-md-8">
														<span style="white-space: nowrap"><span
															style="font-size: 9pt; font-weight: normal;">￥</span>0.00</span>
													</div>
												</div>
											</div>
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">已付金额:</label>
													<div class="form-control  col-md-8">
														<span style="white-space: nowrap"><span
															style="font-size: 9pt; font-weight: normal;">￥</span>${list.payed}</span>
													</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">关联订单客户:</label>
													<div class="form-control  col-md-8">
														<span style="font-weight: normal; color: #9e9e9e">〖</span>${list.cus_name }
														<a
															href="javascript:vopen('/xcrm/customer/customer/detail.xt?id=107','customer107',999,600);"><i
															class="fa fa-folder-open m-l-5" data-toggle="tooltip"
															data-original-title="打开详细页面" data-placement="bottom"></i></a><span
															style="font-weight: normal; color: #9e9e9e">〗</span>
													</div>
												</div>
											</div>
											<div class="col-md-6">
												<div class="form-group ">
													<label class="control-label col-md-4">关联订单:</label>
													<div class="form-control  col-md-8">
														<span style="font-weight: normal; color: #9e9e9e">〖</span>${list.otitle}
														<a><i class="fa fa-folder-open m-l-5" data-toggle="tooltip"
															data-original-title="打开详细页面" data-placement="bottom"></i></a><span
															style="font-weight: normal; color: #9e9e9e">〗</span><i
															title="" class="f-s-16 fa fa-arrow-right text-primary"
															data-toggle="tooltip" data-original-title=""
															data-placement="bottom" data-title="执行中"></i><span
															style="color: gray; font-weight: normal">(设置是否过滤未审批的订单)</span>
														<a class="m-l-5"
															href="/setup/setup.xt?func=purchase_ref_co_id"
															target="_blank" data-toggle="tooltip"
															data-original-title="设置是否过滤未审批的订单"
															data-placement="bottom"><i class="fa fa-cog"></i></a>
													</div>
												</div>
											</div>
										</div>
										
										<div class="row">
											<div class="col-md-12">
												<div class="form-group no-margin">
													<label class="control-label col-md-2">备注:</label>
													<div class="form-control autogrow col-md-10">${list.remark}</div>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-md-12">
												<div class="form-group no-margin">
													<label class="control-label col-md-2">采购物品明细:</label>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="">
												<div class="form-group" style="float:right;width:400px">
													<a class="f-s-12 text-black" style="cursor:pointer;" @click="getOrderHref()" v-if="'${ list.schstates}'=='新采购'"
												><i class="el-icon-edit m-r-5"></i>编辑采购单明细</a>
												
												&nbsp;&nbsp;
											<a class="f-s-12 text-black"
												href="javascript:vopen('/sys/editprice/puritemprint.xt?pu_id=47&amp;mdb=a4eaa3','print',960,530);"><i
													class="ion-printer m-r-5"></i>打印采购单</a>&nbsp;&nbsp;<a
												class="f-s-12 text-black"
												onclick="javascript:openbasepop('导出word打印', 'print_word', 'mdb=752fbc&amp;id=0&amp;type=purchase&amp;t_id=47&amp;t_mdb=a4eaa3&amp;vparse=amF2YXNjcmlwdDp2b3BlbignL3N5cy9lZGl0cHJpY2UvcHVyaXRlbXByaW50Lnh0P3B1X2lkPTQ3Jm1kYj1hNGVhYTMmc2lkPTEyJnNzbj1xa3EyMTNrYmNnZmVyMm9oYWpobXRzZ2UwMyZjY249ZDAwMiZjcj01YjZiYmQ3MzQwYjk4NzEyYTdiOWUwYWFmNmQyZTY0YScsJ3ByaW50JywyMDAsMjAwKTs=', this, 300, 200);"
												href="javascript:void(0)"><i
													class="fa fa-file-word-o m-r-5"></i>导出word打印</a>&nbsp;&nbsp;<a
												class="f-s-12 text-black"
												href="/sys/editprice/puritemprint.xt?pu_id=47&amp;mdb=a4eaa3&amp;sid=12&amp;ssn=qkq213kbcgfer2ohajhmtsge03&amp;ccn=d002&amp;cr=5b6bbd7340b98712a7b9e0aaf6d2e64a&amp;te=1"><i
													class="fa fa-file-excel-o m-r-5"></i>导出excel打印</a>
												</div>
											</div>
										</div>
										<div style="margin-left: 7%;text-align: right;">
											<span style="line-height: normal;">
												<div class="bootstrap-table">
													<div class="fixed-table-container">
														<table class="table table-bordered table-hover"
															id="idtb_product">
															<thead>
																<tr>
																	<th class="th-inner" style="text-align: left"><span
																		style="font-family: 楷体">品名</span></th>
																	<th class="th-inner" style="text-align: left"><span
																		style="font-family: 楷体">规格</span></th>
																	<th class="th-inner" style="text-align: right"><span
																		style="font-family: 楷体">单位</span></th>
																	<th class="th-inner" style="text-align: right"><span
																		style="font-family: 楷体">数量</span></th>
																	<th class="th-inner" style="text-align: right"><span
																		style="font-family: 楷体">已入库</span></th>
																	<th class="th-inner" style="text-align: right"><span
																		style="font-family: 楷体">未入库</span></th>
																	<th class="th-inner" style="text-align: right"><span
																		style="font-family: 楷体">单价</span></th>
																	<th class="th-inner" style="text-align: right"><span
																		style="font-family: 楷体">金额</span></th>
																	<th class="th-inner" style="text-align: left"><span
																		style="font-family: 楷体">备注</span></th>
																</tr>
															</thead>
															<tbody>
																<tr v-for="(l,i) in li">
																	<td class="text-left">{{l.goo_name}} <a title=""
																		href="javascript:vopen('/xcrm/market/product/detail.xt?id=72','product',650,450);"
																		data-toggle="tooltip" data-original-title=""
																		data-placement="bottom" data-title="打开详细页面"><i
																			class="fa fa-folder-open"></i></a>
																	</td>
																	<td class="text-left">-</td>
																	<td class="text-right">{{l.gunit}}</td>
																	<td class="text-right">{{l.purnum}}</td>
																	<td class="text-right">{{l.yesnum}}</td>
																	<td class="text-right">{{l.nonum}}</td>
																	<td class="text-right" style="white-space: nowrap;"><span
																		style="white-space: nowrap"><span
																			style="font-size: 9pt; font-weight: normal;">￥</span>{{l.goo_price}}</span>
																	</td>
																	<td class="text-right" style="white-space: nowrap;"><span
																		style="white-space: nowrap"><span
																			style="font-size: 9pt; font-weight: normal;">￥</span>{{l.purprice}}</span>
																	</td>
																	<td class="text-left"></td>
																</tr>
																<tr>
																	<td class="text-left" colspan="5"><font face="楷体"><b>合计</b></font>
																	</td>
																	<td class="text-right">&nbsp;</td>
																	<td class="text-right">&nbsp;</td>
																	<td class="text-right" style="white-space: nowrap;" >
																	<span style="white-space: nowrap" >
																		<span style="font-size: 9pt; font-weight: normal;">￥</span>
																		{{sumPrice}}
																	</span>
																	<!-- <span style="white-space: nowrap">
																		<span style="font-size: 9pt; font-weight: normal;">￥</span>
																		{{li[0].schsum}} 
																	</span> -->
																	</td>
																	<td class="text-left">&nbsp;</td>
																</tr>
																<tr>
																	<td align="left" colspan="3"><font face="楷体">总计（大写金额）</font>
																	</td>
																	<td align="right" colspan="6"><font face="楷体">{{strchina}}整</font>
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</div> </span>
										</div>
										
										<hr>
										<!--审批！！！！！！！！！！！！！！！！-->
										<div class="col-md-offset-1" style="display: none">
											<p>
												<b>审批状态：</b>
											</p>
											<p>审批记录：</p>
											<blockquote></blockquote>
										</div>
										<!--审批！！！！！！！！！！！！！！！！-->
										<!--UTF8-->

										<div id="flash_but_1550886651"
											style="margin: 10px 0px; text-align: center;">
											<span class="text-left "
												style="cursor: pointer; padding: 8px 12px; border-radius: 3px; background: #dddddd; margin: 10px 0px;"
												onclick="onClickUpload1550886651();"> <i
												class="md  md-attach-file"></i><span set-lan="html:上传附件">上传附件</span>
											</span>
										</div>
										<div id="flash_but1_1550886651"
											style="display: none; text-align: center;">
											<span class="btn btn-d fileinput-button"> <input
												name="ufile" class="f-s-12" id="fileupload_1550886651"
												onchange="if( endFlag ==0 ) {alert('代码还未加载成功!');return;} applyTokenDo(uploadFile);"
												type="file">
											</span>&nbsp;&nbsp;&nbsp;(单个文件小于10M)<br> <br>
											<div class="progress" style="width: 400px; margin: 0px auto;">
												<div class="progress-bar" id="progress-bar1550886651"
													role="progressbar" aria-valuenow="0" aria-valuemin="0"
													aria-valuemax="100" style="min-width: 2em;">0%</div>
											</div>
											<input name="did" class="upflag" type="hidden" value="47"><input
												name="dtname" class="upflag1" type="hidden" value=""><input
												name="comname" class="upflag2" type="hidden" value="qshow">
										</div>
										<div class="p-t-20 text-center">
											<div></div>
											<hr>
										</div>

									</div>
								</div>
							</div>
							<div class="text-right p-20">
								<button class="btn btn-white waves-effect waves-light"
									onclick="vopen('http://cdn.xtcrm.com/cdn/v8/associated_table/?main=purchase&amp;id=47&amp;sid=12&amp;ssn=qkq213kbcgfer2ohajhmtsge03&amp;ccn=d002&amp;cr=5b6bbd7340b98712a7b9e0aaf6d2e64a&amp;origin=http%3A%2F%2Fcrm.xtcrm.com&amp;47&amp;mdb=a4eaa3','actrun',999,600);">
									<i></i>查看关联订单
								</button>
								&nbsp;
								<!--<span class="button_close_qshow"><button class=" btn btn-default waves-effect waves-light m-r-5" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close m-r-5"></i>关闭</button></span>-->

							</div>
						</div>


						<!--UTF8-->
					</div>
				</div>
				<p class="text-right">【说明：入库单撤销 /删除后，此单才可以再次进行编辑操作】</p>
				<div id="purdetailitems" style="z-index: 0">
					<div class="panel panel-default">
						<div class="panel-heading bg-white">
							<h5 class="panel-title">
								<i class="fa fa-yen m-r-5"></i>退货单明细/退货单
							</h5>
						</div>
					</div>
					<!--UTF8-->
				</div>
				<div id="purchaselist" style="z-index: 0">

					<div class="row row-display-box">

						<div class="col-md-6">
							<div class="panel panel-default p-0">

								<div class="panel-heading bg-white">
									<h5 class="panel-title">
										<i class="fa fa-yen m-r-5"></i>付款计划(应付) 
										<a v-if="'${ record.pay}'=='已开发票'"
											@click="showDialog()">
											
										</a>
										<a v-else="'${ record.pay}'!='已开发票'"
											@click="showDialog()">
											<i title="" class="ion-plus"></i>
										</a>
										

									</h5>
									<el-dialog :visible.sync="centerDialogVisible" width="900px"
											center> <iframe src="/payAdd" width="100%" 
											frameborder="0"
											onload="this.height=this.contentWindow.document.body.scrollHeight,this.width =this.contentWindow.document.body.scrollWidth"></iframe> 
										</el-dialog>
								</div>
								<div class="panel-body">
									<i class="fa fa-square text-gray m-r-5"></i>
									<a><span style="white-space: nowrap"><span
											style="font-size: 9pt; font-weight: normal;">￥</span>${record.paynum}</span>
									</a>&nbsp;&nbsp;${record.paytime}&nbsp;&nbsp;
									
									<a  v-if="'${ record.pay}'=='未开发票'"
												style="text-decoration: none; color: #9999ff;cursor:pointer"
												@click="showDialog2()">		
											<i title="未付" class="f-s-16 fa fa-arrow-right text-primary"
												data-original-title="" title=""></i> 
									付款</a>
									
								</div>
							</div>
							<el-dialog :visible.sync="centerDialogVisible2" width="900px"
											center> <iframe src="/gopay" width="100%" 
											frameborder="0"
											onload="this.height=this.contentWindow.document.body.scrollHeight,this.width =this.contentWindow.document.body.scrollWidth"></iframe> 
										</el-dialog>

						</div>
						<div class="col-md-6 panel panel-default p-0">

							<div class="panel-heading bg-white">

								<h5 class="panel-title">
									<i class="md md-receipt m-r-5"></i>付款记录
								</h5>
							</div>
							<div class="panel-body">
								<p>
											<i class="fa fa-square text-gray m-r-5"></i><a @click.stop="delet(colle.pr_id)"><span
												style="white-space: nowrap"><span
													style="font-size: 9pt; font-weight: normal;">￥</span>
													</span></a>${note.paynum }&nbsp;&nbsp;${note.way}&nbsp;&nbsp;${note.partime}
													
													
										</p>
							</div>
						</div>
					</div>

					<!--UTF8-->
				</div>
			</div>
		</div>
	</div>
	<script>
				var vm = new Vue({
					el: "#idid",
					data() {
						return {
							
							li:${li},
							texts: "",
							centerDialogVisible: false,
							centerDialogVisible2: false,
							centerDialogVisible1: false,
							centerDialogVisible4:false,
							dialogVisible:false,
							sumPrice:"",//价格
							 FrameSrc:"",
							 tableItem:[],
								quatitys:'',
								strchina:'',
								sums:'',
							//表格当前页数据
			                tableData: [],
							ruleForm: {
								//搜索框
								input: '',
								//下拉条件按钮
								selects: '',
								 //默认每页数据量
				                pagesize: 10,
				              //当前页码
				                currentPage: 1,
				                //默认数据总数
				                totalCount: '',
						        },
						}
					},
					methods: {
						
						    //编辑明细
						getOrderHref(){
							//alert("能出来吗？？？"+${list.schno});
							var str = JSON.stringify(this.form);
							sessionStorage.obj = str;
							var schno = ${list.schno};
							window.parent.location.replace("/purchasedetail?schno="+schno+"");
						},
						showDialog(){
					    	  this.centerDialogVisible= true;
					      },
					      showDialog2(){
					    	  this.centerDialogVisible2= true;
					      },
					    
						submitForm(formName) {
							//验证方法
							this.$refs[formName].validate((valid) => {
								if(valid) {
									this.loadData();
								} else {
									console.log('error submit!!');
									return false;
								}
							});
						},
						resetForm(formName) {
							this.$refs[formName].resetFields();
						}
					},
					mounted() {
						var cart=${list};
						this.strchina=cart.big;
						this.sumPrice = ${list.schsum};
						
					}
					
					
				});
				console.info('${ list.schstates}'=='新采购');
				console.info('${ record.pay}'=='未开发票');
				console.info('${ record.payid}'=='0');
				
			</script>
			
</body>
</html>